/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "waterbody")
@NamedQueries({
    @NamedQuery(name = "Waterbody.findAll", query = "SELECT w FROM Waterbody w"),
    @NamedQuery(name = "Waterbody.findByIdwaterbody", query = "SELECT w FROM Waterbody w WHERE w.idwaterbody = :idwaterbody"),
    @NamedQuery(name = "Waterbody.findByWaterbody", query = "SELECT w FROM Waterbody w WHERE w.waterbody = :waterbody")})
public class Waterbody implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idwaterbody")
    private Integer idwaterbody;
    @Basic(optional = false)
    @Column(name = "waterbody")
    private String waterbody;
    @OneToMany(mappedBy = "waterbody", fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Waterbody() {
    }

    public Waterbody(Integer idwaterbody) {
        this.idwaterbody = idwaterbody;
    }

    public Waterbody(Integer idwaterbody, String waterbody) {
        this.idwaterbody = idwaterbody;
        this.waterbody = waterbody;
    }

    public Integer getIdwaterbody() {
        return idwaterbody;
    }

    public void setIdwaterbody(Integer idwaterbody) {
        this.idwaterbody = idwaterbody;
    }

    public String getWaterbody() {
        return waterbody;
    }

    public void setWaterbody(String waterbody) {
        this.waterbody = waterbody;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idwaterbody != null ? idwaterbody.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Waterbody)) {
            return false;
        }
        Waterbody other = (Waterbody) object;
        if ((this.idwaterbody == null && other.idwaterbody != null) || (this.idwaterbody != null && !this.idwaterbody.equals(other.idwaterbody))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Waterbody[idwaterbody=" + idwaterbody + "]";
    }

}
